Skip to content

refactor(i18n): sync non-English locales + add CI enforcement for key parity#9009

Merged
sriramveeraghanta merged 1 commit intorefactor-translationsfrom
sync-translations
May 4, 2026
Merged

refactor(i18n): sync non-English locales + add CI enforcement for key parity#9009
sriramveeraghanta merged 1 commit intorefactor-translationsfrom
sync-translations

Conversation

@prateekshourya29
Copy link
Copy Markdown
Member

@prateekshourya29 prateekshourya29 commented May 4, 2026

Description

Phase 2 of the i18n refactor. Closes the English-to-locale sync gap inherited from refactor-translations and adds a CI workflow that blocks future drift. No changes to the public API of @plane/i18n and no changes to how the app loads translations at runtime.

Locale sync: 100% key parity with English

  • Every non-English locale was at partial coverage prior to this PR (≈87% on most, near-100% on de) with stale keys still hanging around from the old monolithic translations.ts.
  • After this PR: all 18 non-English locales are at 3,837 / 3,837 keys — 100% parity with English.
  • Each (locale, namespace) was rebuilt to match the canonical English key shape, filling each leaf with the appropriate per-locale translation. Stale keys were dropped.
  • Translations are machine-quality and should be reviewed by native speakers before release. Tracked as follow-up work; not blocking this PR.

CI enforcement: .github/workflows/i18n-sync-check.yml

  • New GitHub Actions workflow runs tsx packages/i18n/scripts/sync-check.ts --ci on PRs that touch packages/i18n/** or the workflow itself. Also runs on push to preview as a backstop.
  • Fails any PR that introduces missing or stale keys.

Script refactor: shared locale I/O + better error context

  • Extracted inline flattenKeys / loadLocale / LOCALES_DIR out of scripts/sync-check.ts into a new scripts/lib/locale-io.ts module.
  • Added readJsonFile() helper that wraps JSON.parse errors with the offending file path — closes a CI-debugging gap where malformed locale JSON threw with no filename in the error.
  • Behavior-preserving: check:sync output format, per-locale counts, and exit codes are identical to before.

Build tooling: pin tsx in pnpm catalog

  • Replaced npx tsx@4.19.2 … invocations in @plane/i18n scripts with bare tsx …. npx tsx currently resolves to a broken release (tsx@4.21.0 declares an unpublished esbuild~0.27.0), causing local builds to fail with npm error code ETARGET.
  • Pinned tsx: 4.20.6 in the workspace catalog and declared it as a devDependency of @plane/i18n so resolution goes through pnpm, not npx.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Improvement (change that would cause existing functionality to not work as expected)
  • Code refactoring
  • Documentation update

Screenshots and Media (if applicable)

N/A — no visual changes. All existing translations continue to render identically; previously-missing keys now render their translated values instead of falling back to English.

Test Scenarios

  • pnpm --filter=@plane/i18n run check:sync exits 0 with "All locales are in sync with English. No issues found."
  • pnpm --filter=@plane/i18n run build succeeds; keys.generated.ts regenerates cleanly (3,837 keys × 28 namespaces).
  • pnpm --filter=@plane/i18n check:lint / check:types / check:format all pass.
  • actionlint .github/workflows/i18n-sync-check.yml passes.
  • Switching to a non-English locale in user settings — verify previously-missing keys (e.g., empty-state titles, settings sidebar headers, command palette actions) render translated text rather than English fallback.
  • Drift detection — introducing a missing or stale key on a test branch should cause the workflow to fail with a useful log pointing to the offending key.

References

Follow-ups (not in this PR)

  • Native-speaker review of machine translations.
  • Pluralization audit (ICU plural forms differ by language — Slavic languages have 4, Arabic 6).
  • Translation memory / glossary for consistency of domain terms across locales.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 4, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 50440f6a-9ab9-45b9-bb2f-44723f97741a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch sync-translations

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

- All 18 non-English locales filled to 3,837/3,837 keys against the
  canonical English source. Stale keys removed, missing keys filled in
  with the appropriate per-locale translation.
- New scripts/lib/locale-io.ts module shared between sync-check and
  future tooling. readJsonFile() wraps JSON.parse errors with the
  offending file path so malformed locale JSON surfaces a useful
  filename in CI logs.
- New .github/workflows/i18n-sync-check.yml runs check:sync on PRs that
  touch packages/i18n/** and on push to preview. Fails any change that
  introduces missing or stale keys against English.
- Pin tsx@4.20.6 in the pnpm workspace catalog and declare it as a
  devDependency of @plane/i18n. Replace npx tsx@4.19.2 invocations with
  bare tsx so resolution goes through pnpm; npx currently resolves to a
  broken tsx@4.21.0 that pulls an unpublished esbuild range.
@sriramveeraghanta sriramveeraghanta merged commit 054b6ca into refactor-translations May 4, 2026
2 checks passed
@sriramveeraghanta sriramveeraghanta deleted the sync-translations branch May 4, 2026 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants